import React from 'react'
import { breadcrumbs } from '../../../configs/breadcrumbs'
import { Breadcrumb } from 'antd'
import { Link } from 'react-router-dom'

export default function MyBreadCrumbs(props) {
    const {pathname} = props
    const curBreadCrumbs = Object.entries(breadcrumbs).filter(item => item[0] === pathname)  
  return (
    <div>
        <Breadcrumb>
        {
          curBreadCrumbs.map(item =>{
            return <Breadcrumb.Item key={item[0]}>
              {
                item[1].map(item1 =>{
                  return <Link to={item1.link} key={item1.title}>{item1.title}<span  style={{margin:"0 5px"}}>/</span></Link>
                })
              }
            </Breadcrumb.Item>
          })
        }
      </Breadcrumb>
    </div>
  )
}
